<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Class template node_handle</title>
<link rel="stylesheet" href="../../../../doc/src/boostbook.css" type="text/css">
<meta name="generator" content="DocBook XSL Stylesheets V1.79.1">
<link rel="home" href="../../index.html" title="The Boost C++ Libraries BoostBook Documentation Subset">
<link rel="up" href="../../boost_container_header_reference.html#doxygen.boost_container_header_reference.node__handle_8hpp" title="Header &lt;boost/container/node_handle.hpp&gt;">
<link rel="prev" href="structboost_1_1container_1_1insert__return__type__base.html" title="Struct template insert_return_type_base">
<link rel="next" href="structboost_1_1container_1_1block__bytes.html" title="Struct template block_bytes">
<meta name="viewport" content="width=device-width, initial-scale=1">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<table cellpadding="2" width="100%"><tr>
<td valign="top"><img alt="Boost C++ Libraries" width="277" height="86" src="../../../../boost.png"></td>
<td align="center"><a href="../../../../index.html">Home</a></td>
<td align="center"><a href="../../../../libs/libraries.htm">Libraries</a></td>
<td align="center"><a href="http://www.boost.org/users/people.html">People</a></td>
<td align="center"><a href="http://www.boost.org/users/faq.html">FAQ</a></td>
<td align="center"><a href="../../../../more/index.htm">More</a></td>
</tr></table>
<hr>
<div class="spirit-nav">
<a accesskey="p" href="structboost_1_1container_1_1insert__return__type__base.html"><img src="../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../../boost_container_header_reference.html#doxygen.boost_container_header_reference.node__handle_8hpp"><img src="../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../../index.html"><img src="../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="structboost_1_1container_1_1block__bytes.html"><img src="../../../../doc/src/images/next.png" alt="Next"></a>
</div>
<div class="refentry">
<a name="doxygen.boost_container_header_reference.classboost_1_1container_1_1node__handle"></a><div class="titlepage"></div>
<div class="refnamediv">
<h2><span class="refentrytitle">Class template node_handle</span></h2>
<p>boost::container::node_handle</p>
</div>
<h2 class="refsynopsisdiv-title">Synopsis</h2>
<div class="refsynopsisdiv"><pre class="synopsis"><span class="comment">// In header: &lt;<a class="link" href="../../boost_container_header_reference.html#doxygen.boost_container_header_reference.node__handle_8hpp" title="Header &lt;boost/container/node_handle.hpp&gt;">boost/container/node_handle.hpp</a>&gt;

</span><span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> NodeAllocator<span class="special">,</span> <span class="keyword">typename</span> KeyMapped <span class="special">=</span> <span class="keyword">void</span><span class="special">&gt;</span> 
<span class="keyword">class</span> <a class="link" href="classboost_1_1container_1_1node__handle.html" title="Class template node_handle">node_handle</a> <span class="special">{</span>
<span class="keyword">public</span><span class="special">:</span>
  <span class="comment">// types</span>
  <span class="keyword">typedef</span> <span class="identifier">priv_value_t</span>                                                     <a name="doxygen.boost_container_header_reference.classboost_1_1container_1_1node__handle_1aef5a76ac8318fc0a0f9600eaf7c3bab4"></a><span class="identifier">value_type</span><span class="special">;</span>         
  <span class="keyword">typedef</span> <span class="identifier">keymapped_t</span><span class="special">::</span><span class="identifier">key_type</span>                                            <a name="doxygen.boost_container_header_reference.classboost_1_1container_1_1node__handle_1a0a5cbe89e578e8908e9b3d7df8bed01f"></a><span class="identifier">key_type</span><span class="special">;</span>           
  <span class="keyword">typedef</span> <span class="identifier">keymapped_t</span><span class="special">::</span><span class="identifier">mapped_type</span>                                         <a name="doxygen.boost_container_header_reference.classboost_1_1container_1_1node__handle_1a4c8ea2d4d81140bef74bc9abf9f32644"></a><span class="identifier">mapped_type</span><span class="special">;</span>        
  <span class="keyword">typedef</span> <span class="identifier">nator_traits</span><span class="special">::</span><span class="keyword">template</span> <span class="identifier">portable_rebind_alloc</span><span class="special">&lt;</span> <span class="identifier">value_type</span> <span class="special">&gt;</span><span class="special">::</span><span class="identifier">type</span> <a name="doxygen.boost_container_header_reference.classboost_1_1container_1_1node__handle_1a821e498adb9f2109dab646a9b4d27037"></a><span class="identifier">allocator_type</span><span class="special">;</span>     
  <span class="keyword">typedef</span> <span class="identifier">priv_node_t</span>                                                      <a name="doxygen.boost_container_header_reference.classboost_1_1container_1_1node__handle_1a95ca1a9dfe84780166170eb03a5712af"></a><span class="identifier">container_node_type</span><span class="special">;</span>

  <span class="comment">// <a class="link" href="classboost_1_1container_1_1node__handle.html#id72-bb">friend functions</a></span>
  <span class="keyword">void</span> <a class="link" href="classboost_1_1container_1_1node__handle.html#doxygen.boost_container_header_reference.classboost_1_1container_1_1node__handle_1a8b86063217f0e7cd4521287f6e4b8e85"><span class="identifier">swap</span></a><span class="special">(</span><a class="link" href="classboost_1_1container_1_1node__handle.html" title="Class template node_handle">node_handle</a> <span class="special">&amp;</span><span class="special">,</span> <a class="link" href="classboost_1_1container_1_1node__handle.html" title="Class template node_handle">node_handle</a> <span class="special">&amp;</span><span class="special">)</span><span class="special">;</span>

  <span class="comment">// <a class="link" href="classboost_1_1container_1_1node__handle.html#id73-bb">public member functions</a></span>
  <a class="link" href="classboost_1_1container_1_1node__handle.html#doxygen.boost_container_header_reference.classboost_1_1container_1_1node__handle_1a9cc9c59f0b909c2435f07e076e47f67e"><span class="identifier">node_handle</span></a><span class="special">(</span><span class="special">)</span> <span class="keyword">noexcept</span><span class="special">;</span>
  <a class="link" href="classboost_1_1container_1_1node__handle.html#doxygen.boost_container_header_reference.classboost_1_1container_1_1node__handle_1a43adb52500e604f839fc7a0a3570fe63"><span class="identifier">node_handle</span></a><span class="special">(</span><span class="identifier">node_pointer</span><span class="special">,</span> <span class="keyword">const</span> <span class="identifier">nallocator_type</span> <span class="special">&amp;</span><span class="special">)</span> <span class="keyword">noexcept</span><span class="special">;</span>
  <span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> KeyMapped2<span class="special">&gt;</span> 
    <a class="link" href="classboost_1_1container_1_1node__handle.html#doxygen.boost_container_header_reference.classboost_1_1container_1_1node__handle_1abb83db8e102234d8da7c186121d92e86"><span class="identifier">node_handle</span></a><span class="special">(</span><a class="link" href="classboost_1_1container_1_1node__handle.html" title="Class template node_handle">node_handle</a><span class="special">&lt;</span> <span class="identifier">NodeAllocator</span><span class="special">,</span> <span class="identifier">KeyMapped2</span> <span class="special">&gt;</span> <span class="special">&amp;&amp;</span><span class="special">,</span> 
                <span class="keyword">typename</span> <span class="identifier">dtl</span><span class="special">::</span><span class="identifier">enable_if_c</span><span class="special">&lt;</span><span class="special">(</span><span class="special">(</span><span class="keyword">unsigned</span><span class="special">)</span> <span class="identifier">dtl</span><span class="special">::</span><span class="identifier">is_same</span><span class="special">&lt;</span> <span class="identifier">KeyMapped</span><span class="special">,</span> <span class="keyword">void</span> <span class="special">&gt;</span><span class="special">::</span><span class="identifier">value</span><span class="special">+</span><span class="special">(</span><span class="keyword">unsigned</span><span class="special">)</span> <span class="identifier">dtl</span><span class="special">::</span><span class="identifier">is_same</span><span class="special">&lt;</span> <span class="identifier">KeyMapped2</span><span class="special">,</span> <span class="keyword">void</span> <span class="special">&gt;</span><span class="special">::</span><span class="identifier">value</span><span class="special">)</span><span class="special">==</span><span class="number">1u</span> <span class="special">&gt;</span><span class="special">::</span><span class="identifier">type</span> <span class="special">*</span> <span class="special">=</span> <span class="number">0</span><span class="special">)</span> <span class="keyword">noexcept</span><span class="special">;</span>
  <a class="link" href="classboost_1_1container_1_1node__handle.html#doxygen.boost_container_header_reference.classboost_1_1container_1_1node__handle_1a5118301a404f2de93c75b29b02c416ad"><span class="identifier">node_handle</span></a><span class="special">(</span><a class="link" href="classboost_1_1container_1_1node__handle.html" title="Class template node_handle">node_handle</a> <span class="special">&amp;&amp;</span><span class="special">)</span> <span class="keyword">noexcept</span><span class="special">;</span>
  <a class="link" href="classboost_1_1container_1_1node__handle.html#doxygen.boost_container_header_reference.classboost_1_1container_1_1node__handle_1ae5cb74869054b532fdabba7f9f8cbeec"><span class="special">~</span><span class="identifier">node_handle</span></a><span class="special">(</span><span class="special">)</span> <span class="keyword">noexcept</span><span class="special">;</span>
  <a class="link" href="classboost_1_1container_1_1node__handle.html" title="Class template node_handle">node_handle</a> <span class="special">&amp;</span> <a class="link" href="classboost_1_1container_1_1node__handle.html#doxygen.boost_container_header_reference.classboost_1_1container_1_1node__handle_1ae26d8dcdd87f52ebfe43165f23cc09c2"><span class="keyword">operator</span><span class="special">=</span></a><span class="special">(</span><a class="link" href="classboost_1_1container_1_1node__handle.html" title="Class template node_handle">node_handle</a> <span class="special">&amp;&amp;</span><span class="special">)</span> <span class="keyword">noexcept</span><span class="special">;</span>
  <span class="identifier">value_type</span> <span class="special">&amp;</span> <a class="link" href="classboost_1_1container_1_1node__handle.html#doxygen.boost_container_header_reference.classboost_1_1container_1_1node__handle_1a0dcb6d76d1024a1e802d670c3445c60c"><span class="identifier">value</span></a><span class="special">(</span><span class="special">)</span> <span class="keyword">const</span> <span class="keyword">noexcept</span><span class="special">;</span>
  <span class="identifier">key_type</span> <span class="special">&amp;</span> <a class="link" href="classboost_1_1container_1_1node__handle.html#doxygen.boost_container_header_reference.classboost_1_1container_1_1node__handle_1a887b2748a60e2edc483c724755ec9c8e"><span class="identifier">key</span></a><span class="special">(</span><span class="special">)</span> <span class="keyword">const</span> <span class="keyword">noexcept</span><span class="special">;</span>
  <span class="identifier">mapped_type</span> <span class="special">&amp;</span> <a class="link" href="classboost_1_1container_1_1node__handle.html#doxygen.boost_container_header_reference.classboost_1_1container_1_1node__handle_1a1dd83745804abdedbfe9f9416bad8437"><span class="identifier">mapped</span></a><span class="special">(</span><span class="special">)</span> <span class="keyword">const</span> <span class="keyword">noexcept</span><span class="special">;</span>
  <span class="identifier">allocator_type</span> <a class="link" href="classboost_1_1container_1_1node__handle.html#doxygen.boost_container_header_reference.classboost_1_1container_1_1node__handle_1a862d2fb383fd2f644d8e34e49df1e5e5"><span class="identifier">get_allocator</span></a><span class="special">(</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span>
  <span class="keyword">explicit</span> <a class="link" href="classboost_1_1container_1_1node__handle.html#doxygen.boost_container_header_reference.classboost_1_1container_1_1node__handle_1ab90585c6b84481296394495888a0a6b6"><span class="keyword">operator</span> <span class="keyword">bool</span></a><span class="special">(</span><span class="special">)</span> <span class="keyword">const</span> <span class="keyword">noexcept</span><span class="special">;</span>
  <span class="keyword">bool</span> <a class="link" href="classboost_1_1container_1_1node__handle.html#doxygen.boost_container_header_reference.classboost_1_1container_1_1node__handle_1a468c38bf1da6782c7fbf50dfd25183ea"><span class="identifier">empty</span></a><span class="special">(</span><span class="special">)</span> <span class="keyword">const</span> <span class="keyword">noexcept</span><span class="special">;</span>
  <span class="keyword">void</span> <a class="link" href="classboost_1_1container_1_1node__handle.html#doxygen.boost_container_header_reference.classboost_1_1container_1_1node__handle_1aa981540e91562a7453159b2023e0e15e"><span class="identifier">swap</span></a><span class="special">(</span><a class="link" href="classboost_1_1container_1_1node__handle.html" title="Class template node_handle">node_handle</a> <span class="special">&amp;</span><span class="special">)</span><span class="special">;</span>
  <span class="identifier">node_pointer</span> <a class="link" href="classboost_1_1container_1_1node__handle.html#doxygen.boost_container_header_reference.classboost_1_1container_1_1node__handle_1a64f3cb4f0a08bcdee221559a2a2d4c81"><span class="identifier">release</span></a><span class="special">(</span><span class="special">)</span> <span class="keyword">noexcept</span><span class="special">;</span>
  <span class="identifier">node_pointer</span> <a class="link" href="classboost_1_1container_1_1node__handle.html#doxygen.boost_container_header_reference.classboost_1_1container_1_1node__handle_1aa9dc6248709f56cea3987ffb8a81f36b"><span class="identifier">get</span></a><span class="special">(</span><span class="special">)</span> <span class="keyword">const</span> <span class="keyword">noexcept</span><span class="special">;</span>
  <span class="identifier">nallocator_type</span> <span class="special">&amp;</span> <a class="link" href="classboost_1_1container_1_1node__handle.html#doxygen.boost_container_header_reference.classboost_1_1container_1_1node__handle_1af1325cead2acf66c8016663c8350cee0"><span class="identifier">node_alloc</span></a><span class="special">(</span><span class="special">)</span> <span class="keyword">noexcept</span><span class="special">;</span>
  <span class="keyword">const</span> <span class="identifier">nallocator_type</span> <span class="special">&amp;</span> <a class="link" href="classboost_1_1container_1_1node__handle.html#doxygen.boost_container_header_reference.classboost_1_1container_1_1node__handle_1ad2ada3000b0ce0ddc34354c7f8df64bc"><span class="identifier">node_alloc</span></a><span class="special">(</span><span class="special">)</span> <span class="keyword">const</span> <span class="keyword">noexcept</span><span class="special">;</span>
<span class="special">}</span><span class="special">;</span></pre></div>
<div class="refsect1">
<a name="id-1.3.8.14.20.4.4"></a><h2>Description</h2>
<p>A <a class="link" href="classboost_1_1container_1_1node__handle.html" title="Class template node_handle">node_handle</a> is an object that accepts ownership of a single element from an associative container. It may be used to transfer that ownership to another container with compatible nodes. Containers with compatible nodes have the same node handle type. Elements may be transferred in either direction between container types in the same row:.</p>
<p>Container types with compatible nodes</p>
<p>map&lt;K, T, C1, A&gt; &lt;-&gt; map&lt;K, T, C2, A&gt;</p>
<p>map&lt;K, T, C1, A&gt; &lt;-&gt; multimap&lt;K, T, C2, A&gt;</p>
<p>set&lt;K, C1, A&gt; &lt;-&gt; set&lt;K, C2, A&gt;</p>
<p>set&lt;K, C1, A&gt; &lt;-&gt; multiset&lt;K, C2, A&gt;</p>
<p>If a node handle is not empty, then it contains an allocator that is equal to the allocator of the container when the element was extracted. If a node handle is empty, it contains no allocator. </p>
<div class="refsect2">
<a name="id-1.3.8.14.20.4.4.9"></a><h3>
<a name="id72-bb"></a><code class="computeroutput">node_handle</code> friend functions</h3>
<div class="orderedlist"><ol class="orderedlist" type="1"><li class="listitem">
<pre class="literallayout"><span class="keyword">void</span> <a name="doxygen.boost_container_header_reference.classboost_1_1container_1_1node__handle_1a8b86063217f0e7cd4521287f6e4b8e85"></a><span class="identifier">swap</span><span class="special">(</span><a class="link" href="classboost_1_1container_1_1node__handle.html" title="Class template node_handle">node_handle</a> <span class="special">&amp;</span> x<span class="special">,</span> <a class="link" href="classboost_1_1container_1_1node__handle.html" title="Class template node_handle">node_handle</a> <span class="special">&amp;</span> y<span class="special">)</span><span class="special">;</span></pre>
<p><span class="bold"><strong>Effects</strong></span>: x.swap(y). </p>
</li></ol></div>
</div>
<div class="refsect2">
<a name="id-1.3.8.14.20.4.4.10"></a><h3>
<a name="id73-bb"></a><code class="computeroutput">node_handle</code> public member functions</h3>
<div class="orderedlist"><ol class="orderedlist" type="1">
<li class="listitem">
<pre class="literallayout"><a name="doxygen.boost_container_header_reference.classboost_1_1container_1_1node__handle_1a9cc9c59f0b909c2435f07e076e47f67e"></a><span class="identifier">node_handle</span><span class="special">(</span><span class="special">)</span> <span class="keyword">noexcept</span><span class="special">;</span></pre>
<p><span class="bold"><strong>Effects</strong></span>: Initializes m_ptr to nullptr.</p>
<p><span class="bold"><strong>Postcondition</strong></span>: this-&gt;<a class="link" href="classboost_1_1container_1_1node__handle.html#doxygen.boost_container_header_reference.classboost_1_1container_1_1node__handle_1a468c38bf1da6782c7fbf50dfd25183ea">empty()</a> </p>
</li>
<li class="listitem">
<pre class="literallayout"><a name="doxygen.boost_container_header_reference.classboost_1_1container_1_1node__handle_1a43adb52500e604f839fc7a0a3570fe63"></a><span class="identifier">node_handle</span><span class="special">(</span><span class="identifier">node_pointer</span> p<span class="special">,</span> <span class="keyword">const</span> <span class="identifier">nallocator_type</span> <span class="special">&amp;</span> al<span class="special">)</span> <span class="keyword">noexcept</span><span class="special">;</span></pre>
<p><span class="bold"><strong>Effects</strong></span>: Constructs a <a class="link" href="classboost_1_1container_1_1node__handle.html" title="Class template node_handle">node_handle</a> object initializing internal pointer with p. If p != nullptr copy constructs internal allocator from al. </p>
</li>
<li class="listitem">
<pre class="literallayout"><span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> KeyMapped2<span class="special">&gt;</span> 
  <a name="doxygen.boost_container_header_reference.classboost_1_1container_1_1node__handle_1abb83db8e102234d8da7c186121d92e86"></a><span class="identifier">node_handle</span><span class="special">(</span><a class="link" href="classboost_1_1container_1_1node__handle.html" title="Class template node_handle">node_handle</a><span class="special">&lt;</span> <span class="identifier">NodeAllocator</span><span class="special">,</span> <span class="identifier">KeyMapped2</span> <span class="special">&gt;</span> <span class="special">&amp;&amp;</span> nh<span class="special">,</span> 
              <span class="keyword">typename</span> <span class="identifier">dtl</span><span class="special">::</span><span class="identifier">enable_if_c</span><span class="special">&lt;</span><span class="special">(</span><span class="special">(</span><span class="keyword">unsigned</span><span class="special">)</span> <span class="identifier">dtl</span><span class="special">::</span><span class="identifier">is_same</span><span class="special">&lt;</span> <span class="identifier">KeyMapped</span><span class="special">,</span> <span class="keyword">void</span> <span class="special">&gt;</span><span class="special">::</span><span class="identifier">value</span><span class="special">+</span><span class="special">(</span><span class="keyword">unsigned</span><span class="special">)</span> <span class="identifier">dtl</span><span class="special">::</span><span class="identifier">is_same</span><span class="special">&lt;</span> <span class="identifier">KeyMapped2</span><span class="special">,</span> <span class="keyword">void</span> <span class="special">&gt;</span><span class="special">::</span><span class="identifier">value</span><span class="special">)</span><span class="special">==</span><span class="number">1u</span> <span class="special">&gt;</span><span class="special">::</span><span class="identifier">type</span> <span class="special">*</span> <span class="special">=</span> <span class="number">0</span><span class="special">)</span> <span class="keyword">noexcept</span><span class="special">;</span></pre>
<p><span class="bold"><strong>Effects</strong></span>: Constructs a <a class="link" href="classboost_1_1container_1_1node__handle.html" title="Class template node_handle">node_handle</a> object initializing internal pointer with a related nh's internal pointer and assigns nullptr to the later. If nh's internal pointer was not nullptr, move constructs internal allocator with nh's internal allocator and destroy nh's internal allocator.</p>
<p><span class="bold"><strong>Postcondition</strong></span>: nh.empty()</p>
<p><span class="bold"><strong>Note</strong></span>: Two <a class="link" href="classboost_1_1container_1_1node__handle.html" title="Class template node_handle">node_handle</a>'s are related if only one of KeyMapped template parameter of a node handle is void. </p>
</li>
<li class="listitem">
<pre class="literallayout"><a name="doxygen.boost_container_header_reference.classboost_1_1container_1_1node__handle_1a5118301a404f2de93c75b29b02c416ad"></a><span class="identifier">node_handle</span><span class="special">(</span><a class="link" href="classboost_1_1container_1_1node__handle.html" title="Class template node_handle">node_handle</a> <span class="special">&amp;&amp;</span> nh<span class="special">)</span> <span class="keyword">noexcept</span><span class="special">;</span></pre>
<p><span class="bold"><strong>Effects</strong></span>: Constructs a <a class="link" href="classboost_1_1container_1_1node__handle.html" title="Class template node_handle">node_handle</a> object initializing internal pointer with nh's internal pointer and assigns nullptr to the later. If nh's internal pointer was not nullptr, move constructs internal allocator with nh's internal allocator and destroy nh's internal allocator.</p>
<p><span class="bold"><strong>Postcondition</strong></span>: nh.empty() </p>
</li>
<li class="listitem">
<pre class="literallayout"><a name="doxygen.boost_container_header_reference.classboost_1_1container_1_1node__handle_1ae5cb74869054b532fdabba7f9f8cbeec"></a><span class="special">~</span><span class="identifier">node_handle</span><span class="special">(</span><span class="special">)</span> <span class="keyword">noexcept</span><span class="special">;</span></pre>
<p><span class="bold"><strong>Effects</strong></span>: If !this-&gt;<a class="link" href="classboost_1_1container_1_1node__handle.html#doxygen.boost_container_header_reference.classboost_1_1container_1_1node__handle_1a468c38bf1da6782c7fbf50dfd25183ea">empty()</a>, destroys the value_type subobject in the container_node_type object pointed to by c by calling <a class="link" href="structboost_1_1container_1_1allocator__traits.html#doxygen.boost_container_header_reference.structboost_1_1container_1_1allocator__traits_1a709a15dc30bce1784bdeac20e628eb32">allocator_traits&lt;impl_defined&gt;::destroy</a>, then deallocates m_ptr by calling <a class="link" href="structboost_1_1container_1_1allocator__traits.html#doxygen.boost_container_header_reference.structboost_1_1container_1_1allocator__traits_1a92aa2dc105cd5b34f73ef8680a0c681e">nator_traits::rebind_traits&lt;container_node_type&gt;::deallocate</a>. </p>
</li>
<li class="listitem">
<pre class="literallayout"><a class="link" href="classboost_1_1container_1_1node__handle.html" title="Class template node_handle">node_handle</a> <span class="special">&amp;</span> <a name="doxygen.boost_container_header_reference.classboost_1_1container_1_1node__handle_1ae26d8dcdd87f52ebfe43165f23cc09c2"></a><span class="keyword">operator</span><span class="special">=</span><span class="special">(</span><a class="link" href="classboost_1_1container_1_1node__handle.html" title="Class template node_handle">node_handle</a> <span class="special">&amp;&amp;</span> nh<span class="special">)</span> <span class="keyword">noexcept</span><span class="special">;</span></pre>
<p><span class="bold"><strong>Requires</strong></span>: Either this-&gt;<a class="link" href="classboost_1_1container_1_1node__handle.html#doxygen.boost_container_header_reference.classboost_1_1container_1_1node__handle_1a468c38bf1da6782c7fbf50dfd25183ea">empty()</a>, or <a class="link" href="structboost_1_1container_1_1allocator__traits.html#doxygen.boost_container_header_reference.structboost_1_1container_1_1allocator__traits_1a6a01cdcf2ea5a5d3b0e6fd85a9350a02">nator_traits::propagate_on_container_move_assignment</a> is true, or <a class="link" href="classboost_1_1container_1_1node__handle.html#doxygen.boost_container_header_reference.classboost_1_1container_1_1node__handle_1af1325cead2acf66c8016663c8350cee0">node_alloc()</a> == nh.node_alloc().</p>
<p><span class="bold"><strong>Effects</strong></span>: If m_ptr != nullptr, destroys the value_type subobject in the container_node_type object pointed to by m_ptr by calling <a class="link" href="structboost_1_1container_1_1allocator__traits.html#doxygen.boost_container_header_reference.structboost_1_1container_1_1allocator__traits_1a709a15dc30bce1784bdeac20e628eb32">nator_traits::destroy</a>, then deallocates m_ptr by calling <a class="link" href="structboost_1_1container_1_1allocator__traits.html#doxygen.boost_container_header_reference.structboost_1_1container_1_1allocator__traits_1a92aa2dc105cd5b34f73ef8680a0c681e">nator_traits::deallocate</a>. Assigns nh.m_ptr to m_ptr. If this-&gt;<a class="link" href="classboost_1_1container_1_1node__handle.html#doxygen.boost_container_header_reference.classboost_1_1container_1_1node__handle_1a468c38bf1da6782c7fbf50dfd25183ea">empty()</a> or <a class="link" href="structboost_1_1container_1_1allocator__traits.html#doxygen.boost_container_header_reference.structboost_1_1container_1_1allocator__traits_1a6a01cdcf2ea5a5d3b0e6fd85a9350a02">nator_traits::propagate_on_container_move_assignment</a> is true, move assigns nh.node_alloc() to <a class="link" href="classboost_1_1container_1_1node__handle.html#doxygen.boost_container_header_reference.classboost_1_1container_1_1node__handle_1af1325cead2acf66c8016663c8350cee0">node_alloc()</a>. Assigns nullptr to nh.m_ptr and assigns nullopt to nh.node_alloc().</p>
<p><span class="bold"><strong>Returns</strong></span>: *this.</p>
<p><span class="bold"><strong>Throws</strong></span>: Nothing. </p>
</li>
<li class="listitem">
<pre class="literallayout"><span class="identifier">value_type</span> <span class="special">&amp;</span> <a name="doxygen.boost_container_header_reference.classboost_1_1container_1_1node__handle_1a0dcb6d76d1024a1e802d670c3445c60c"></a><span class="identifier">value</span><span class="special">(</span><span class="special">)</span> <span class="keyword">const</span> <span class="keyword">noexcept</span><span class="special">;</span></pre>
<p><span class="bold"><strong>Requires</strong></span>: <a class="link" href="classboost_1_1container_1_1node__handle.html#doxygen.boost_container_header_reference.classboost_1_1container_1_1node__handle_1a468c38bf1da6782c7fbf50dfd25183ea">empty()</a> == false.</p>
<p><span class="bold"><strong>Returns</strong></span>: A reference to the value_type subobject in the container_node_type object pointed to by m_ptr</p>
<p><span class="bold"><strong>Throws</strong></span>: Nothing. </p>
</li>
<li class="listitem">
<pre class="literallayout"><span class="identifier">key_type</span> <span class="special">&amp;</span> <a name="doxygen.boost_container_header_reference.classboost_1_1container_1_1node__handle_1a887b2748a60e2edc483c724755ec9c8e"></a><span class="identifier">key</span><span class="special">(</span><span class="special">)</span> <span class="keyword">const</span> <span class="keyword">noexcept</span><span class="special">;</span></pre>
<p><span class="bold"><strong>Requires</strong></span>: <a class="link" href="classboost_1_1container_1_1node__handle.html#doxygen.boost_container_header_reference.classboost_1_1container_1_1node__handle_1a468c38bf1da6782c7fbf50dfd25183ea">empty()</a> == false.</p>
<p><span class="bold"><strong>Returns</strong></span>: A non-const reference to the key_type member of the value_type subobject in the container_node_type object pointed to by m_ptr.</p>
<p><span class="bold"><strong>Throws</strong></span>: Nothing.</p>
<p><span class="bold"><strong>Requires</strong></span>: Modifying the key through the returned reference is permitted. </p>
</li>
<li class="listitem">
<pre class="literallayout"><span class="identifier">mapped_type</span> <span class="special">&amp;</span> <a name="doxygen.boost_container_header_reference.classboost_1_1container_1_1node__handle_1a1dd83745804abdedbfe9f9416bad8437"></a><span class="identifier">mapped</span><span class="special">(</span><span class="special">)</span> <span class="keyword">const</span> <span class="keyword">noexcept</span><span class="special">;</span></pre>
<p><span class="bold"><strong>Requires</strong></span>: <a class="link" href="classboost_1_1container_1_1node__handle.html#doxygen.boost_container_header_reference.classboost_1_1container_1_1node__handle_1a468c38bf1da6782c7fbf50dfd25183ea">empty()</a> == false.</p>
<p><span class="bold"><strong>Returns</strong></span>: A reference to the mapped_type member of the value_type subobject in the container_node_type object pointed to by m_ptr</p>
<p><span class="bold"><strong>Throws</strong></span>: Nothing. </p>
</li>
<li class="listitem">
<pre class="literallayout"><span class="identifier">allocator_type</span> <a name="doxygen.boost_container_header_reference.classboost_1_1container_1_1node__handle_1a862d2fb383fd2f644d8e34e49df1e5e5"></a><span class="identifier">get_allocator</span><span class="special">(</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span></pre>
<p><span class="bold"><strong>Requires</strong></span>: <a class="link" href="classboost_1_1container_1_1node__handle.html#doxygen.boost_container_header_reference.classboost_1_1container_1_1node__handle_1a468c38bf1da6782c7fbf50dfd25183ea">empty()</a> == false.</p>
<p><span class="bold"><strong>Returns</strong></span>: A copy of the internally hold allocator.</p>
<p><span class="bold"><strong>Throws</strong></span>: Nothing. </p>
</li>
<li class="listitem">
<pre class="literallayout"><span class="keyword">explicit</span> <a name="doxygen.boost_container_header_reference.classboost_1_1container_1_1node__handle_1ab90585c6b84481296394495888a0a6b6"></a><span class="keyword">operator</span> <span class="keyword">bool</span><span class="special">(</span><span class="special">)</span> <span class="keyword">const</span> <span class="keyword">noexcept</span><span class="special">;</span></pre>
<p><span class="bold"><strong>Returns</strong></span>: m_ptr != nullptr. </p>
</li>
<li class="listitem">
<pre class="literallayout"><span class="keyword">bool</span> <a name="doxygen.boost_container_header_reference.classboost_1_1container_1_1node__handle_1a468c38bf1da6782c7fbf50dfd25183ea"></a><span class="identifier">empty</span><span class="special">(</span><span class="special">)</span> <span class="keyword">const</span> <span class="keyword">noexcept</span><span class="special">;</span></pre>
<p><span class="bold"><strong>Returns</strong></span>: m_ptr == nullptr. </p>
</li>
<li class="listitem">
<pre class="literallayout"><span class="keyword">void</span> <a name="doxygen.boost_container_header_reference.classboost_1_1container_1_1node__handle_1aa981540e91562a7453159b2023e0e15e"></a><span class="identifier">swap</span><span class="special">(</span><a class="link" href="classboost_1_1container_1_1node__handle.html" title="Class template node_handle">node_handle</a> <span class="special">&amp;</span> nh<span class="special">)</span><span class="special">;</span></pre>
<p><span class="bold"><strong>Requires</strong></span>: this-&gt;<a class="link" href="classboost_1_1container_1_1node__handle.html#doxygen.boost_container_header_reference.classboost_1_1container_1_1node__handle_1a468c38bf1da6782c7fbf50dfd25183ea">empty()</a>, or nh.empty(), or <a class="link" href="structboost_1_1container_1_1allocator__traits.html#doxygen.boost_container_header_reference.structboost_1_1container_1_1allocator__traits_1a55319ee59516f8e4a0432a26fce6145f">nator_traits::propagate_on_container_swap</a> is true, or <a class="link" href="classboost_1_1container_1_1node__handle.html#doxygen.boost_container_header_reference.classboost_1_1container_1_1node__handle_1af1325cead2acf66c8016663c8350cee0">node_alloc()</a> == nh.node_alloc().</p>
<p><span class="bold"><strong>Effects</strong></span>: Calls swap(m_ptr, nh.m_ptr). If this-&gt;<a class="link" href="classboost_1_1container_1_1node__handle.html#doxygen.boost_container_header_reference.classboost_1_1container_1_1node__handle_1a468c38bf1da6782c7fbf50dfd25183ea">empty()</a>, or nh.empty(), or nator_traits::propagate_on_- container_swap is true calls swap(<a class="link" href="classboost_1_1container_1_1node__handle.html#doxygen.boost_container_header_reference.classboost_1_1container_1_1node__handle_1af1325cead2acf66c8016663c8350cee0">node_alloc()</a>, nh.node_alloc()). </p>
</li>
<li class="listitem">
<pre class="literallayout"><span class="identifier">node_pointer</span> <a name="doxygen.boost_container_header_reference.classboost_1_1container_1_1node__handle_1a64f3cb4f0a08bcdee221559a2a2d4c81"></a><span class="identifier">release</span><span class="special">(</span><span class="special">)</span> <span class="keyword">noexcept</span><span class="special">;</span></pre>
<p><span class="bold"><strong>Effects</strong></span>: If this-&gt;<a class="link" href="classboost_1_1container_1_1node__handle.html#doxygen.boost_container_header_reference.classboost_1_1container_1_1node__handle_1a468c38bf1da6782c7fbf50dfd25183ea">empty()</a> returns nullptr, otherwise returns m_ptr resets m_ptr to nullptr and destroys the internal allocator.</p>
<p><span class="bold"><strong>Postcondition</strong></span>: this-&gt;<a class="link" href="classboost_1_1container_1_1node__handle.html#doxygen.boost_container_header_reference.classboost_1_1container_1_1node__handle_1a468c38bf1da6782c7fbf50dfd25183ea">empty()</a></p>
<p><span class="bold"><strong>Note</strong></span>: Non-standard extensions </p>
</li>
<li class="listitem">
<pre class="literallayout"><span class="identifier">node_pointer</span> <a name="doxygen.boost_container_header_reference.classboost_1_1container_1_1node__handle_1aa9dc6248709f56cea3987ffb8a81f36b"></a><span class="identifier">get</span><span class="special">(</span><span class="special">)</span> <span class="keyword">const</span> <span class="keyword">noexcept</span><span class="special">;</span></pre>
<p><span class="bold"><strong>Effects</strong></span>: Returns m_ptr.</p>
<p><span class="bold"><strong>Note</strong></span>: Non-standard extensions </p>
</li>
<li class="listitem">
<pre class="literallayout"><span class="identifier">nallocator_type</span> <span class="special">&amp;</span> <a name="doxygen.boost_container_header_reference.classboost_1_1container_1_1node__handle_1af1325cead2acf66c8016663c8350cee0"></a><span class="identifier">node_alloc</span><span class="special">(</span><span class="special">)</span> <span class="keyword">noexcept</span><span class="special">;</span></pre>
<p><span class="bold"><strong>Effects</strong></span>: Returns a reference to the internal node allocator.</p>
<p><span class="bold"><strong>Note</strong></span>: Non-standard extensions </p>
</li>
<li class="listitem">
<pre class="literallayout"><span class="keyword">const</span> <span class="identifier">nallocator_type</span> <span class="special">&amp;</span> <a name="doxygen.boost_container_header_reference.classboost_1_1container_1_1node__handle_1ad2ada3000b0ce0ddc34354c7f8df64bc"></a><span class="identifier">node_alloc</span><span class="special">(</span><span class="special">)</span> <span class="keyword">const</span> <span class="keyword">noexcept</span><span class="special">;</span></pre>
<p><span class="bold"><strong>Effects</strong></span>: Returns a reference to the internal node allocator.</p>
<p><span class="bold"><strong>Note</strong></span>: Non-standard extensions </p>
</li>
</ol></div>
</div>
</div>
</div>
<div class="copyright-footer">Copyright © 2009-2018 Ion Gaztanaga<p>
        Distributed under the Boost Software License, Version 1.0. (See accompanying
        file LICENSE_1_0.txt or copy at <a href="http://www.boost.org/LICENSE_1_0.txt" target="_top">http://www.boost.org/LICENSE_1_0.txt</a>)
      </p>
</div>
<hr>
<div class="spirit-nav">
<a accesskey="p" href="structboost_1_1container_1_1insert__return__type__base.html"><img src="../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../../boost_container_header_reference.html#doxygen.boost_container_header_reference.node__handle_8hpp"><img src="../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../../index.html"><img src="../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="structboost_1_1container_1_1block__bytes.html"><img src="../../../../doc/src/images/next.png" alt="Next"></a>
</div>
</body>
</html>
